QT       += core gui
QT       += network
QT       += multimedia multimediawidgets
QT       += serialport
QT       += charts
QT       += printsupport

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11
## set prj name
TARGET = view_eyes_host

## add pacp
NpcapHome += $$PWD/software/npcap-sdk-1.13
INCLUDEPATH += \
        $${NpcapHome}/Include \
        $${NpcapHome}/Include/pcap

LIBS   += \
        $${NpcapHome}/Lib/x64/Packet.lib \
        $${NpcapHome}/Lib/x64/wpcap.lib \
        $${NpcapHome}/Lib/Packet.lib \
        $${NpcapHome}/Lib/wpcap.lib

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
    main.cpp \
    mainwindow.cpp \
    src/chart_blck/chart_blck.cpp \
    src/cmd_blck/cmd_blck.cpp \
    src/cuda_subs/cuda_mdle.cpp \
    src/file_mdle/file_mdle.cpp \
    src/flow_blck/flow_blck.cpp \
    src/fpga_subs/fpga_subs.cpp \
    src/help_blck/version_blck.cpp \
    src/once_blck/once_blck.cpp \
    src/open_source_lib/qcustomplot.cpp \
    src/team_mdle/markdownhighlighter.cpp \
    src/team_mdle/team_mdle.cpp \
    src/tools_blck/hex_cacu.cpp \
    src/tools_blck/npcap_monitor.cpp \
    src/uart_blck/uart_blck.cpp \
    src/udp_subs/udp_subs.cpp \
    src/uvc_blck/uvc_blck.cpp \
    src/uvc_blck/videosurface_driv/videosurface_driv.cpp \
    src/wave_mdle/wave_mdle.cpp \
    src/welcome_mdle/welcome_mdle.cpp

HEADERS += \
    mainwindow.h \
    src/MACRO.h \
    src/chart_blck/chart_blck.h \
    src/cmd_blck/cmd_blck.h \
    src/cuda_subs/cuda_mdle.h \
    src/file_mdle/file_mdle.h \
    src/flow_blck/flow_blck.h \
    src/fpga_subs/fpga_subs.h \
    src/help_blck/version_blck.h \
    src/once_blck/once_blck.h \
    src/open_source_lib/qcustomplot.h \
    src/team_mdle/markdownhighlighter.h \
    src/team_mdle/team_mdle.h \
    src/tools_blck/hex_cacu.h \
    src/tools_blck/npcap_monitor.h \
    src/uart_blck/uart_blck.h \
    src/udp_subs/udp_subs.h \
    src/uvc_blck/uvc_blck.h \
    src/uvc_blck/videosurface_driv/videosurface_driv.h \
    src/wave_mdle/wave_mdle.h \
    src/welcome_mdle/welcome_mdle.h

FORMS += \
    mainwindow.ui \
    src/chart_blck/chart_blck.ui \
    src/cmd_blck/cmd_blck.ui \
    src/cuda_subs/cuda_mdle.ui \
    src/file_mdle/file_mdle.ui \
    src/flow_blck/flow_blck.ui \
    src/fpga_subs/fpga_subs.ui \
    src/help_blck/version_blck.ui \
    src/once_blck/once_blck.ui \
    src/team_mdle/team_mdle.ui \
    src/tools_blck/hex_cacu.ui \
    src/tools_blck/npcap_monitor.ui \
    src/uart_blck/uart_blck.ui \
    src/udp_subs/udp_subs.ui \
    src/uvc_blck/uvc_blck.ui \
    src/wave_mdle/wave_mdle.ui \
    src/welcome_mdle/welcome_mdle.ui

# ico
RC_ICONS = reco_eye.ico

# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target




defineReplace(win32Path) {#定义替换

    win32:1 ~= s|/|\\\\|g
    contains(1, ^\\.*):pfx = \\
    else:pfx =
    segs = $$split(1, \\)#
    out =
    for(seg, segs) {
        equals(seg, ..):out = $$member(out, 0)
        else:!equals(seg, .):out += $$seg
    }
    return($$join(out, \\, $$pfx))
}


## ==============================================
## set debug

win32 {
    bat.commands  = $$win32Path("$$PWD/qt_bat/qt_qmake_pre.bat") release $$win32Path("$$PWD/../../")#run before make
    first.depends = $(first) bat
    export(first.depends)
    export(bat.commands)
    QMAKE_EXTRA_TARGETS += first bat#other goal
#    CONFIG( debug, debug|release) {
#        QMAKE_POST_LINK += $$win32Path("$$PWD/qt_bat/qt_qmake_post.bat") release $$win32Path("$$PWD/../../")#
#    } else {
#        QMAKE_POST_LINK += $$win32Path("$$PWD/qt_bat/qt_qmake_post.bat") release $$win32Path("$$PWD/../../")#
#    }

}


## release add debug
QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
QMAKE_LFLAGS_RELEASE = $$QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO

## libs

win32: LIBS += -L$$PWD/src/cuda_subs/cuda_dll/lib/ -lcuda_dll

INCLUDEPATH += $$PWD/src/cuda_subs/cuda_dll/include
DEPENDPATH += $$PWD/src/cuda_subs/cuda_dll/include

RESOURCES += \
    ico.qrc


